package com.xiaoai.poitest.contrller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author
 * @Date 2021-07-07 21:53
 */
@Controller
public class TestContrller {

    @RequestMapping(value = "/hello",method = RequestMethod.GET)
    @ResponseBody
    public String sayHello(String name){
        return "hello "+name;
    }

    @RequestMapping("/thymeleaf")
    public String hello(HttpServletRequest request, @RequestParam(value = "name", defaultValue = "springboot-thymeleaf") String name) {
        request.setAttribute("name", name);
        return "hello";
    }


}
